using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class HRM_TRAININGData : DatabaseObjectBase
	{
		public HRM_TRAININGData()
		{
			Initialize(true);
		}
		public HRM_TRAININGData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 HRM_TRAINING_Insert(String TrainingCode, String TrainingName, String Description, String Purpose, String Form, String Location, String Certificate, Int32 Quantity, Decimal MoneyOneEmployee, Decimal MoneyOneCompany, Decimal MoneyOneTotal, Decimal MoneyAllEmployee, Decimal MoneyAllCompany, Decimal MoneyAllTotal, Decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, String DecideNumber, DateTime DecideDate, String DecidePerson, String PartnerName, String PartnerAddress, String PartnerPhone, String PartnerFax, String PartnerWebsite, String PartnerEmail, String PersonName, String PersonPhone, String PersonPosition, String PersonAddress, String PersonEmail, Int32 Status)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("HRM_TRAINING_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@TrainingCode", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@TrainingName", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Purpose", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Form", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Location", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Certificate", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Quantity", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyOneEmployee", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyOneCompany", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyOneTotal", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyAllEmployee", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyAllCompany", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyAllTotal", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@MoneyTotal", SqlDbType.Money));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PrepareFromDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PrepareToDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@RegisterFromDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@RegisterToDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PerformFromDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PerformToDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@DecideNumber", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@DecideDate", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@DecidePerson", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PartnerName", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PartnerAddress", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PartnerPhone", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PartnerFax", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PartnerWebsite", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PartnerEmail", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PersonName", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PersonPhone", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PersonPosition", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PersonAddress", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@PersonEmail", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Status", SqlDbType.Int));
				_dbadapter.InsertCommand.Prepare();
				SqlString TrainingCodeSQL = TrainingCode;
				_dbadapter.InsertCommand.Parameters["@TrainingCode"].Value = TrainingCodeSQL;
				SqlString TrainingNameSQL = TrainingName;
				_dbadapter.InsertCommand.Parameters["@TrainingName"].Value = TrainingNameSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.InsertCommand.Parameters["@Description"].Value = DescriptionSQL;
				SqlString PurposeSQL = Purpose;
				_dbadapter.InsertCommand.Parameters["@Purpose"].Value = PurposeSQL;
				SqlString FormSQL = Form;
				_dbadapter.InsertCommand.Parameters["@Form"].Value = FormSQL;
				SqlString LocationSQL = Location;
				_dbadapter.InsertCommand.Parameters["@Location"].Value = LocationSQL;
				SqlString CertificateSQL = Certificate;
				_dbadapter.InsertCommand.Parameters["@Certificate"].Value = CertificateSQL;
				SqlInt32 QuantitySQL = Quantity;
				_dbadapter.InsertCommand.Parameters["@Quantity"].Value = QuantitySQL;
				SqlMoney MoneyOneEmployeeSQL = MoneyOneEmployee;
				_dbadapter.InsertCommand.Parameters["@MoneyOneEmployee"].Value = MoneyOneEmployeeSQL;
				SqlMoney MoneyOneCompanySQL = MoneyOneCompany;
				_dbadapter.InsertCommand.Parameters["@MoneyOneCompany"].Value = MoneyOneCompanySQL;
				SqlMoney MoneyOneTotalSQL = MoneyOneTotal;
				_dbadapter.InsertCommand.Parameters["@MoneyOneTotal"].Value = MoneyOneTotalSQL;
				SqlMoney MoneyAllEmployeeSQL = MoneyAllEmployee;
				_dbadapter.InsertCommand.Parameters["@MoneyAllEmployee"].Value = MoneyAllEmployeeSQL;
				SqlMoney MoneyAllCompanySQL = MoneyAllCompany;
				_dbadapter.InsertCommand.Parameters["@MoneyAllCompany"].Value = MoneyAllCompanySQL;
				SqlMoney MoneyAllTotalSQL = MoneyAllTotal;
				_dbadapter.InsertCommand.Parameters["@MoneyAllTotal"].Value = MoneyAllTotalSQL;
				SqlMoney MoneyTotalSQL = MoneyTotal;
				_dbadapter.InsertCommand.Parameters["@MoneyTotal"].Value = MoneyTotalSQL;
				SqlDateTime PrepareFromDateSQL = SqlDateTime.Null;
				if (PrepareFromDate > DateTime.MinValue)
				{
					try
					{
						PrepareFromDateSQL = PrepareFromDate;
					}
					catch (Exception ePrepareFromDate)
					{
						String PrepareFromDateMessage = ePrepareFromDate.Message;
						PrepareFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@PrepareFromDate"].Value = PrepareFromDateSQL;
				SqlDateTime PrepareToDateSQL = SqlDateTime.Null;
				if (PrepareToDate > DateTime.MinValue)
				{
					try
					{
						PrepareToDateSQL = PrepareToDate;
					}
					catch (Exception ePrepareToDate)
					{
						String PrepareToDateMessage = ePrepareToDate.Message;
						PrepareToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@PrepareToDate"].Value = PrepareToDateSQL;
				SqlDateTime RegisterFromDateSQL = SqlDateTime.Null;
				if (RegisterFromDate > DateTime.MinValue)
				{
					try
					{
						RegisterFromDateSQL = RegisterFromDate;
					}
					catch (Exception eRegisterFromDate)
					{
						String RegisterFromDateMessage = eRegisterFromDate.Message;
						RegisterFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@RegisterFromDate"].Value = RegisterFromDateSQL;
				SqlDateTime RegisterToDateSQL = SqlDateTime.Null;
				if (RegisterToDate > DateTime.MinValue)
				{
					try
					{
						RegisterToDateSQL = RegisterToDate;
					}
					catch (Exception eRegisterToDate)
					{
						String RegisterToDateMessage = eRegisterToDate.Message;
						RegisterToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@RegisterToDate"].Value = RegisterToDateSQL;
				SqlDateTime PerformFromDateSQL = SqlDateTime.Null;
				if (PerformFromDate > DateTime.MinValue)
				{
					try
					{
						PerformFromDateSQL = PerformFromDate;
					}
					catch (Exception ePerformFromDate)
					{
						String PerformFromDateMessage = ePerformFromDate.Message;
						PerformFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@PerformFromDate"].Value = PerformFromDateSQL;
				SqlDateTime PerformToDateSQL = SqlDateTime.Null;
				if (PerformToDate > DateTime.MinValue)
				{
					try
					{
						PerformToDateSQL = PerformToDate;
					}
					catch (Exception ePerformToDate)
					{
						String PerformToDateMessage = ePerformToDate.Message;
						PerformToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@PerformToDate"].Value = PerformToDateSQL;
				SqlString DecideNumberSQL = DecideNumber;
				_dbadapter.InsertCommand.Parameters["@DecideNumber"].Value = DecideNumberSQL;
				SqlDateTime DecideDateSQL = SqlDateTime.Null;
				if (DecideDate > DateTime.MinValue)
				{
					try
					{
						DecideDateSQL = DecideDate;
					}
					catch (Exception eDecideDate)
					{
						String DecideDateMessage = eDecideDate.Message;
						DecideDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@DecideDate"].Value = DecideDateSQL;
				SqlString DecidePersonSQL = DecidePerson;
				_dbadapter.InsertCommand.Parameters["@DecidePerson"].Value = DecidePersonSQL;
				SqlString PartnerNameSQL = PartnerName;
				_dbadapter.InsertCommand.Parameters["@PartnerName"].Value = PartnerNameSQL;
				SqlString PartnerAddressSQL = PartnerAddress;
				_dbadapter.InsertCommand.Parameters["@PartnerAddress"].Value = PartnerAddressSQL;
				SqlString PartnerPhoneSQL = PartnerPhone;
				_dbadapter.InsertCommand.Parameters["@PartnerPhone"].Value = PartnerPhoneSQL;
				SqlString PartnerFaxSQL = PartnerFax;
				_dbadapter.InsertCommand.Parameters["@PartnerFax"].Value = PartnerFaxSQL;
				SqlString PartnerWebsiteSQL = PartnerWebsite;
				_dbadapter.InsertCommand.Parameters["@PartnerWebsite"].Value = PartnerWebsiteSQL;
				SqlString PartnerEmailSQL = PartnerEmail;
				_dbadapter.InsertCommand.Parameters["@PartnerEmail"].Value = PartnerEmailSQL;
				SqlString PersonNameSQL = PersonName;
				_dbadapter.InsertCommand.Parameters["@PersonName"].Value = PersonNameSQL;
				SqlString PersonPhoneSQL = PersonPhone;
				_dbadapter.InsertCommand.Parameters["@PersonPhone"].Value = PersonPhoneSQL;
				SqlString PersonPositionSQL = PersonPosition;
				_dbadapter.InsertCommand.Parameters["@PersonPosition"].Value = PersonPositionSQL;
				SqlString PersonAddressSQL = PersonAddress;
				_dbadapter.InsertCommand.Parameters["@PersonAddress"].Value = PersonAddressSQL;
				SqlString PersonEmailSQL = PersonEmail;
				_dbadapter.InsertCommand.Parameters["@PersonEmail"].Value = PersonEmailSQL;
				SqlInt32 StatusSQL = Status;
				_dbadapter.InsertCommand.Parameters["@Status"].Value = StatusSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TRAINING_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TRAINING_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TRAINING_Update(String TrainingCode, String TrainingName, String Description, String Purpose, String Form, String Location, String Certificate, Int32 Quantity, Decimal MoneyOneEmployee, Decimal MoneyOneCompany, Decimal MoneyOneTotal, Decimal MoneyAllEmployee, Decimal MoneyAllCompany, Decimal MoneyAllTotal, Decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, String DecideNumber, DateTime DecideDate, String DecidePerson, String PartnerName, String PartnerAddress, String PartnerPhone, String PartnerFax, String PartnerWebsite, String PartnerEmail, String PersonName, String PersonPhone, String PersonPosition, String PersonAddress, String PersonEmail, Int32 Status)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_TRAINING_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TrainingCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TrainingName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Purpose", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Form", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Location", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Certificate", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Quantity", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyOneEmployee", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyOneCompany", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyOneTotal", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyAllEmployee", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyAllCompany", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyAllTotal", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyTotal", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PrepareFromDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PrepareToDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RegisterFromDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RegisterToDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PerformFromDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PerformToDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecideNumber", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecideDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecidePerson", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerAddress", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerPhone", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerFax", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerWebsite", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerEmail", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonPhone", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonPosition", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonAddress", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonEmail", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Status", SqlDbType.Int));
				_dbadapter.UpdateCommand.Prepare();
				SqlString TrainingCodeSQL = TrainingCode;
				_dbadapter.UpdateCommand.Parameters["@TrainingCode"].Value = TrainingCodeSQL;
				SqlString TrainingNameSQL = TrainingName;
				_dbadapter.UpdateCommand.Parameters["@TrainingName"].Value = TrainingNameSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.UpdateCommand.Parameters["@Description"].Value = DescriptionSQL;
				SqlString PurposeSQL = Purpose;
				_dbadapter.UpdateCommand.Parameters["@Purpose"].Value = PurposeSQL;
				SqlString FormSQL = Form;
				_dbadapter.UpdateCommand.Parameters["@Form"].Value = FormSQL;
				SqlString LocationSQL = Location;
				_dbadapter.UpdateCommand.Parameters["@Location"].Value = LocationSQL;
				SqlString CertificateSQL = Certificate;
				_dbadapter.UpdateCommand.Parameters["@Certificate"].Value = CertificateSQL;
				SqlInt32 QuantitySQL = Quantity;
				_dbadapter.UpdateCommand.Parameters["@Quantity"].Value = QuantitySQL;
				SqlMoney MoneyOneEmployeeSQL = MoneyOneEmployee;
				_dbadapter.UpdateCommand.Parameters["@MoneyOneEmployee"].Value = MoneyOneEmployeeSQL;
				SqlMoney MoneyOneCompanySQL = MoneyOneCompany;
				_dbadapter.UpdateCommand.Parameters["@MoneyOneCompany"].Value = MoneyOneCompanySQL;
				SqlMoney MoneyOneTotalSQL = MoneyOneTotal;
				_dbadapter.UpdateCommand.Parameters["@MoneyOneTotal"].Value = MoneyOneTotalSQL;
				SqlMoney MoneyAllEmployeeSQL = MoneyAllEmployee;
				_dbadapter.UpdateCommand.Parameters["@MoneyAllEmployee"].Value = MoneyAllEmployeeSQL;
				SqlMoney MoneyAllCompanySQL = MoneyAllCompany;
				_dbadapter.UpdateCommand.Parameters["@MoneyAllCompany"].Value = MoneyAllCompanySQL;
				SqlMoney MoneyAllTotalSQL = MoneyAllTotal;
				_dbadapter.UpdateCommand.Parameters["@MoneyAllTotal"].Value = MoneyAllTotalSQL;
				SqlMoney MoneyTotalSQL = MoneyTotal;
				_dbadapter.UpdateCommand.Parameters["@MoneyTotal"].Value = MoneyTotalSQL;
				SqlDateTime PrepareFromDateSQL = SqlDateTime.Null;
				if (PrepareFromDate > DateTime.MinValue)
				{
					try
					{
						PrepareFromDateSQL = PrepareFromDate;
					}
					catch (Exception ePrepareFromDate)
					{
						String PrepareFromDateMessage = ePrepareFromDate.Message;
						PrepareFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PrepareFromDate"].Value = PrepareFromDateSQL;
				SqlDateTime PrepareToDateSQL = SqlDateTime.Null;
				if (PrepareToDate > DateTime.MinValue)
				{
					try
					{
						PrepareToDateSQL = PrepareToDate;
					}
					catch (Exception ePrepareToDate)
					{
						String PrepareToDateMessage = ePrepareToDate.Message;
						PrepareToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PrepareToDate"].Value = PrepareToDateSQL;
				SqlDateTime RegisterFromDateSQL = SqlDateTime.Null;
				if (RegisterFromDate > DateTime.MinValue)
				{
					try
					{
						RegisterFromDateSQL = RegisterFromDate;
					}
					catch (Exception eRegisterFromDate)
					{
						String RegisterFromDateMessage = eRegisterFromDate.Message;
						RegisterFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@RegisterFromDate"].Value = RegisterFromDateSQL;
				SqlDateTime RegisterToDateSQL = SqlDateTime.Null;
				if (RegisterToDate > DateTime.MinValue)
				{
					try
					{
						RegisterToDateSQL = RegisterToDate;
					}
					catch (Exception eRegisterToDate)
					{
						String RegisterToDateMessage = eRegisterToDate.Message;
						RegisterToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@RegisterToDate"].Value = RegisterToDateSQL;
				SqlDateTime PerformFromDateSQL = SqlDateTime.Null;
				if (PerformFromDate > DateTime.MinValue)
				{
					try
					{
						PerformFromDateSQL = PerformFromDate;
					}
					catch (Exception ePerformFromDate)
					{
						String PerformFromDateMessage = ePerformFromDate.Message;
						PerformFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PerformFromDate"].Value = PerformFromDateSQL;
				SqlDateTime PerformToDateSQL = SqlDateTime.Null;
				if (PerformToDate > DateTime.MinValue)
				{
					try
					{
						PerformToDateSQL = PerformToDate;
					}
					catch (Exception ePerformToDate)
					{
						String PerformToDateMessage = ePerformToDate.Message;
						PerformToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PerformToDate"].Value = PerformToDateSQL;
				SqlString DecideNumberSQL = DecideNumber;
				_dbadapter.UpdateCommand.Parameters["@DecideNumber"].Value = DecideNumberSQL;
				SqlDateTime DecideDateSQL = SqlDateTime.Null;
				if (DecideDate > DateTime.MinValue)
				{
					try
					{
						DecideDateSQL = DecideDate;
					}
					catch (Exception eDecideDate)
					{
						String DecideDateMessage = eDecideDate.Message;
						DecideDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@DecideDate"].Value = DecideDateSQL;
				SqlString DecidePersonSQL = DecidePerson;
				_dbadapter.UpdateCommand.Parameters["@DecidePerson"].Value = DecidePersonSQL;
				SqlString PartnerNameSQL = PartnerName;
				_dbadapter.UpdateCommand.Parameters["@PartnerName"].Value = PartnerNameSQL;
				SqlString PartnerAddressSQL = PartnerAddress;
				_dbadapter.UpdateCommand.Parameters["@PartnerAddress"].Value = PartnerAddressSQL;
				SqlString PartnerPhoneSQL = PartnerPhone;
				_dbadapter.UpdateCommand.Parameters["@PartnerPhone"].Value = PartnerPhoneSQL;
				SqlString PartnerFaxSQL = PartnerFax;
				_dbadapter.UpdateCommand.Parameters["@PartnerFax"].Value = PartnerFaxSQL;
				SqlString PartnerWebsiteSQL = PartnerWebsite;
				_dbadapter.UpdateCommand.Parameters["@PartnerWebsite"].Value = PartnerWebsiteSQL;
				SqlString PartnerEmailSQL = PartnerEmail;
				_dbadapter.UpdateCommand.Parameters["@PartnerEmail"].Value = PartnerEmailSQL;
				SqlString PersonNameSQL = PersonName;
				_dbadapter.UpdateCommand.Parameters["@PersonName"].Value = PersonNameSQL;
				SqlString PersonPhoneSQL = PersonPhone;
				_dbadapter.UpdateCommand.Parameters["@PersonPhone"].Value = PersonPhoneSQL;
				SqlString PersonPositionSQL = PersonPosition;
				_dbadapter.UpdateCommand.Parameters["@PersonPosition"].Value = PersonPositionSQL;
				SqlString PersonAddressSQL = PersonAddress;
				_dbadapter.UpdateCommand.Parameters["@PersonAddress"].Value = PersonAddressSQL;
				SqlString PersonEmailSQL = PersonEmail;
				_dbadapter.UpdateCommand.Parameters["@PersonEmail"].Value = PersonEmailSQL;
				SqlInt32 StatusSQL = Status;
				_dbadapter.UpdateCommand.Parameters["@Status"].Value = StatusSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TRAINING_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TRAINING_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TRAINING_Disable(String TrainingCode, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_TRAINING_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TrainingCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlString TrainingCodeSQL = TrainingCode;
				_dbadapter.UpdateCommand.Parameters["@TrainingCode"].Value = TrainingCodeSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TRAINING_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TRAINING_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TRAINING_Delete(String TrainingCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("HRM_TRAINING_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@TrainingCode", SqlDbType.VarChar, 20));
				_dbadapter.DeleteCommand.Prepare();
				SqlString TrainingCodeSQL = TrainingCode;
				_dbadapter.DeleteCommand.Parameters["@TrainingCode"].Value = TrainingCodeSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TRAINING_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TRAINING_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 HRM_TRAINING_Save(String TrainingCode, String TrainingName, String Description, String Purpose, String Form, String Location, String Certificate, Int32 Quantity, Decimal MoneyOneEmployee, Decimal MoneyOneCompany, Decimal MoneyOneTotal, Decimal MoneyAllEmployee, Decimal MoneyAllCompany, Decimal MoneyAllTotal, Decimal MoneyTotal, DateTime PrepareFromDate, DateTime PrepareToDate, DateTime RegisterFromDate, DateTime RegisterToDate, DateTime PerformFromDate, DateTime PerformToDate, String DecideNumber, DateTime DecideDate, String DecidePerson, String PartnerName, String PartnerAddress, String PartnerPhone, String PartnerFax, String PartnerWebsite, String PartnerEmail, String PersonName, String PersonPhone, String PersonPosition, String PersonAddress, String PersonEmail, Int32 Status)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("HRM_TRAINING_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TrainingCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@TrainingName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Purpose", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Form", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Location", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Certificate", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Quantity", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyOneEmployee", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyOneCompany", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyOneTotal", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyAllEmployee", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyAllCompany", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyAllTotal", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@MoneyTotal", SqlDbType.Money));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PrepareFromDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PrepareToDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RegisterFromDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@RegisterToDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PerformFromDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PerformToDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecideNumber", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecideDate", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@DecidePerson", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerAddress", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerPhone", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerFax", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerWebsite", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PartnerEmail", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonPhone", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonPosition", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonAddress", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@PersonEmail", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Status", SqlDbType.Int));
				_dbadapter.UpdateCommand.Prepare();
				SqlString TrainingCodeSQL = TrainingCode;
				_dbadapter.UpdateCommand.Parameters["@TrainingCode"].Value = TrainingCodeSQL;
				SqlString TrainingNameSQL = TrainingName;
				_dbadapter.UpdateCommand.Parameters["@TrainingName"].Value = TrainingNameSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.UpdateCommand.Parameters["@Description"].Value = DescriptionSQL;
				SqlString PurposeSQL = Purpose;
				_dbadapter.UpdateCommand.Parameters["@Purpose"].Value = PurposeSQL;
				SqlString FormSQL = Form;
				_dbadapter.UpdateCommand.Parameters["@Form"].Value = FormSQL;
				SqlString LocationSQL = Location;
				_dbadapter.UpdateCommand.Parameters["@Location"].Value = LocationSQL;
				SqlString CertificateSQL = Certificate;
				_dbadapter.UpdateCommand.Parameters["@Certificate"].Value = CertificateSQL;
				SqlInt32 QuantitySQL = Quantity;
				_dbadapter.UpdateCommand.Parameters["@Quantity"].Value = QuantitySQL;
				SqlMoney MoneyOneEmployeeSQL = MoneyOneEmployee;
				_dbadapter.UpdateCommand.Parameters["@MoneyOneEmployee"].Value = MoneyOneEmployeeSQL;
				SqlMoney MoneyOneCompanySQL = MoneyOneCompany;
				_dbadapter.UpdateCommand.Parameters["@MoneyOneCompany"].Value = MoneyOneCompanySQL;
				SqlMoney MoneyOneTotalSQL = MoneyOneTotal;
				_dbadapter.UpdateCommand.Parameters["@MoneyOneTotal"].Value = MoneyOneTotalSQL;
				SqlMoney MoneyAllEmployeeSQL = MoneyAllEmployee;
				_dbadapter.UpdateCommand.Parameters["@MoneyAllEmployee"].Value = MoneyAllEmployeeSQL;
				SqlMoney MoneyAllCompanySQL = MoneyAllCompany;
				_dbadapter.UpdateCommand.Parameters["@MoneyAllCompany"].Value = MoneyAllCompanySQL;
				SqlMoney MoneyAllTotalSQL = MoneyAllTotal;
				_dbadapter.UpdateCommand.Parameters["@MoneyAllTotal"].Value = MoneyAllTotalSQL;
				SqlMoney MoneyTotalSQL = MoneyTotal;
				_dbadapter.UpdateCommand.Parameters["@MoneyTotal"].Value = MoneyTotalSQL;
				SqlDateTime PrepareFromDateSQL = SqlDateTime.Null;
				if (PrepareFromDate > DateTime.MinValue)
				{
					try
					{
						PrepareFromDateSQL = PrepareFromDate;
					}
					catch (Exception ePrepareFromDate)
					{
						String PrepareFromDateMessage = ePrepareFromDate.Message;
						PrepareFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PrepareFromDate"].Value = PrepareFromDateSQL;
				SqlDateTime PrepareToDateSQL = SqlDateTime.Null;
				if (PrepareToDate > DateTime.MinValue)
				{
					try
					{
						PrepareToDateSQL = PrepareToDate;
					}
					catch (Exception ePrepareToDate)
					{
						String PrepareToDateMessage = ePrepareToDate.Message;
						PrepareToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PrepareToDate"].Value = PrepareToDateSQL;
				SqlDateTime RegisterFromDateSQL = SqlDateTime.Null;
				if (RegisterFromDate > DateTime.MinValue)
				{
					try
					{
						RegisterFromDateSQL = RegisterFromDate;
					}
					catch (Exception eRegisterFromDate)
					{
						String RegisterFromDateMessage = eRegisterFromDate.Message;
						RegisterFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@RegisterFromDate"].Value = RegisterFromDateSQL;
				SqlDateTime RegisterToDateSQL = SqlDateTime.Null;
				if (RegisterToDate > DateTime.MinValue)
				{
					try
					{
						RegisterToDateSQL = RegisterToDate;
					}
					catch (Exception eRegisterToDate)
					{
						String RegisterToDateMessage = eRegisterToDate.Message;
						RegisterToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@RegisterToDate"].Value = RegisterToDateSQL;
				SqlDateTime PerformFromDateSQL = SqlDateTime.Null;
				if (PerformFromDate > DateTime.MinValue)
				{
					try
					{
						PerformFromDateSQL = PerformFromDate;
					}
					catch (Exception ePerformFromDate)
					{
						String PerformFromDateMessage = ePerformFromDate.Message;
						PerformFromDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PerformFromDate"].Value = PerformFromDateSQL;
				SqlDateTime PerformToDateSQL = SqlDateTime.Null;
				if (PerformToDate > DateTime.MinValue)
				{
					try
					{
						PerformToDateSQL = PerformToDate;
					}
					catch (Exception ePerformToDate)
					{
						String PerformToDateMessage = ePerformToDate.Message;
						PerformToDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@PerformToDate"].Value = PerformToDateSQL;
				SqlString DecideNumberSQL = DecideNumber;
				_dbadapter.UpdateCommand.Parameters["@DecideNumber"].Value = DecideNumberSQL;
				SqlDateTime DecideDateSQL = SqlDateTime.Null;
				if (DecideDate > DateTime.MinValue)
				{
					try
					{
						DecideDateSQL = DecideDate;
					}
					catch (Exception eDecideDate)
					{
						String DecideDateMessage = eDecideDate.Message;
						DecideDateSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@DecideDate"].Value = DecideDateSQL;
				SqlString DecidePersonSQL = DecidePerson;
				_dbadapter.UpdateCommand.Parameters["@DecidePerson"].Value = DecidePersonSQL;
				SqlString PartnerNameSQL = PartnerName;
				_dbadapter.UpdateCommand.Parameters["@PartnerName"].Value = PartnerNameSQL;
				SqlString PartnerAddressSQL = PartnerAddress;
				_dbadapter.UpdateCommand.Parameters["@PartnerAddress"].Value = PartnerAddressSQL;
				SqlString PartnerPhoneSQL = PartnerPhone;
				_dbadapter.UpdateCommand.Parameters["@PartnerPhone"].Value = PartnerPhoneSQL;
				SqlString PartnerFaxSQL = PartnerFax;
				_dbadapter.UpdateCommand.Parameters["@PartnerFax"].Value = PartnerFaxSQL;
				SqlString PartnerWebsiteSQL = PartnerWebsite;
				_dbadapter.UpdateCommand.Parameters["@PartnerWebsite"].Value = PartnerWebsiteSQL;
				SqlString PartnerEmailSQL = PartnerEmail;
				_dbadapter.UpdateCommand.Parameters["@PartnerEmail"].Value = PartnerEmailSQL;
				SqlString PersonNameSQL = PersonName;
				_dbadapter.UpdateCommand.Parameters["@PersonName"].Value = PersonNameSQL;
				SqlString PersonPhoneSQL = PersonPhone;
				_dbadapter.UpdateCommand.Parameters["@PersonPhone"].Value = PersonPhoneSQL;
				SqlString PersonPositionSQL = PersonPosition;
				_dbadapter.UpdateCommand.Parameters["@PersonPosition"].Value = PersonPositionSQL;
				SqlString PersonAddressSQL = PersonAddress;
				_dbadapter.UpdateCommand.Parameters["@PersonAddress"].Value = PersonAddressSQL;
				SqlString PersonEmailSQL = PersonEmail;
				_dbadapter.UpdateCommand.Parameters["@PersonEmail"].Value = PersonEmailSQL;
				SqlInt32 StatusSQL = Status;
				_dbadapter.UpdateCommand.Parameters["@Status"].Value = StatusSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: HRM_TRAINING_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: HRM_TRAINING_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_TRAINING_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_TRAINING_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_TRAINING_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet HRM_TRAINING_Get(String TrainingCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("HRM_TRAINING_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@TrainingCode", SqlDbType.VarChar, 20));
				_dbadapter.SelectCommand.Prepare();
				SqlString TrainingCodeSQL = TrainingCode;
				_dbadapter.SelectCommand.Parameters["@TrainingCode"].Value = TrainingCodeSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: HRM_TRAINING_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
	}
}
